import request from '@/utils/request'

// 查询费用分配列表
export function listAllocation(query) {
	return request({
		url: '/charge/allocation/list',
		method: 'post',
		data: query,
		params: {
			pageSize: query.pageSize,
			pageNum: query.pageNum
		}
	})
}

// 查询费用分配详细
export function getAllocation(allocationId) {
	return request({
		url: '/charge/allocation/' + allocationId,
		method: 'get'
	})
}

// 新增费用分配
export function addAllocation(data) {
	return request({
		url: '/charge/allocation',
		method: 'post',
		data: data
	})
}

// 修改费用分配
export function updateAllocation(data) {
	return request({
		url: '/charge/allocation',
		method: 'put',
		data: data
	})
}

// 删除费用分配
export function delAllocation(allocationId) {
	return request({
		url: '/charge/allocation/' + allocationId,
		method: 'delete'
	})
}

//查询所有小区名称
export function getCommunity(query) {
	return request({
		url: '/charge/allocation/findCommunity',
		method: 'get',
		params: query
	})
}

// 查询楼座单元房间
export function getBalconyUnitHome(query) {
	return request({
		url: '/charge/allocation/findBalconyUnitHome',
		method: 'get',
		params: query
	})
}